<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    <form id="form1">
      <input type="text" name="user">
      <input type="password" name="pass">
      <input type="file" name="f1">
      <input type="button" id="btn" value="提交">
    </form>
    <script src="../../js/jquery.js"></script>
    <script>
      $("#btn").click(()=>{
        let data = new FormData();
        data.append("user",form1.user.value)
        data.append("password",form1.pass.value)
        data.append("f1",form1.f1.files[0])
        console.log(data)
        console.log(form1.f1.files[0])
          $.ajax({
            type:"post",
            url:"http://localhost:8080/upload",
            data:data,
            dataType:"json",
            contentType:false,
            processData:false,
            success:function(){
              console.log("11111111111")
            }
          })
      })
      
    </script>
  </body>
</html>
